#ifndef CHATUSERWID_H
#define CHATUSERWID_H

#include "listitembase.h"
#include "userdata.h"

#include <QWidget>

namespace Ui {
class ChatUserWid;
}

// 用户聊天条目类 TODO
class ChatUserWid : public ListItemBase
{
    Q_OBJECT

public:
    explicit ChatUserWid(QWidget *parent = nullptr);
    ~ChatUserWid();

    QSize sizeHint() const override {
        return QSize(250, 70); // 返回自定义的尺寸
    }

    void setInfo(std::shared_ptr<UserInfo> user_info);
    void setInfo(std::shared_ptr<FriendInfo> friend_info);

    void showRedPoint(bool b_show);

    std::shared_ptr<UserInfo> getUserInfo();

    void updateLastMsg(QVector<std::shared_ptr<TextChatData>> msgs);

private:
    Ui::ChatUserWid *ui;
    std::shared_ptr<UserInfo> m_user_info;

};

#endif // CHATUSERWID_H
